package club.banyuan.demo.demo3;

import java.util.Calendar;
import java.util.Scanner;

/**
 * @author edz
 * @version 1.0
 * @date 2020/12/5 下午3:09
 */
public class CalendarTest {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入");
        int year=scanner.nextInt();
        Calendar c = Calendar.getInstance();
        c.set(year,2,1);
        c.add(Calendar.DATE,-1);
        int date=c.get(Calendar.DATE);
        System.out.println(year+"年的2月份有"+date+"天");

    }
}
